﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>My JSP 'index.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
</head>

<body>
<div align="center">
    <table border="1">
        <tr>
            <td>编号</td>
            <td>电影名称</td>
            <td>价格</td>
            <td>详情</td>
            <td>操作</td>

        </tr>
        <c:if test="${!empty sessionScope.all}">

            <c:forEach items="${sessionScope.all}" var="o" varStatus="i">
                <tr <c:if test="${i.index%2==0}"> style="background-color:cyan;" </c:if> >

                    <td>${o.id}</td>
                    <td>${o.filmName}</td>
                    <td>${o.price}</td>
                    <td>${o.details}</td>


                    <td>
                        <a href="delOrder?id=${o.id}" onclick="javascript:return confirm('确定删除吗?')">删除</a>
                        <a href="insert.jsp">新增</a>
                        <a href="selectid?id=${o.id}">修改</a>
                    </td>

                </tr>
            </c:forEach>
        </c:if>
    </table>
    <a href="pegeAll?pageIndex=1">首页</a>
    <a href="pegeAll?pageIndex=${to-1 }">上一页</a>
    <a href="pegeAll?pageIndex=${to+1 }">下一页</a>
    <a href="pegeAll?pageIndex=${co }">尾页</a>
    <p>当前页数:[${to}/${co }]</p

</div>
</body>
</html>
